package com.ruoyi.web.ydz.service.impl;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.web.ydz.domain.SmsVerification;
import com.ruoyi.web.ydz.mapper.SmsVerificationMapper;
import com.ruoyi.web.ydz.service.ISmsVerificationService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * 短信验证码管理Service业务层处理
 * 
 * @author DRX
 * @date 2024-10-15
 */
@Service
public class SmsVerificationServiceImpl implements ISmsVerificationService
{
    @Resource
    private SmsVerificationMapper smsVerificationMapper;

    /**
     * 查询短信验证码管理
     * 
     * @param id 短信验证码管理主键
     * @return 短信验证码管理
     */
    @Override
    public SmsVerification selectSmsVerificationById(Long id)
    {
        return smsVerificationMapper.selectSmsVerificationById(id);
    }

    /**
     * 查询短信验证码管理列表
     * 
     * @param smsVerification 短信验证码管理
     * @return 短信验证码管理
     */
    @Override
    public List<SmsVerification> selectSmsVerificationList(SmsVerification smsVerification)
    {
        return smsVerificationMapper.selectSmsVerificationList(smsVerification);
    }

    /**
     * 新增短信验证码管理
     * 
     * @param smsVerification 短信验证码管理
     * @return 结果
     */
    @Override
    public int insertSmsVerification(SmsVerification smsVerification)
    {
        smsVerification.setCreateTime(DateUtils.getNowDate());
        return smsVerificationMapper.insertSmsVerification(smsVerification);
    }

    /**
     * 修改短信验证码管理
     * 
     * @param smsVerification 短信验证码管理
     * @return 结果
     */
    @Override
    public int updateSmsVerification(SmsVerification smsVerification)
    {
        smsVerification.setUpdateTime(DateUtils.getNowDate());
        return smsVerificationMapper.updateSmsVerification(smsVerification);
    }

    /**
     * 批量删除短信验证码管理
     * 
     * @param ids 需要删除的短信验证码管理主键
     * @return 结果
     */
    @Override
    public int deleteSmsVerificationByIds(Long[] ids)
    {
        return smsVerificationMapper.deleteSmsVerificationByIds(ids);
    }

    /**
     * 删除短信验证码管理信息
     * 
     * @param id 短信验证码管理主键
     * @return 结果
     */
    @Override
    public int deleteSmsVerificationById(Long id)
    {
        return smsVerificationMapper.deleteSmsVerificationById(id);
    }
}
